package com.lin.fengxiu.repository;

import com.lin.fengxiu.model.Banner;
import com.lin.fengxiu.model.Spu;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;


/**
 * @ClassName SpuRepository
 * @Description TODO
 * @Author wushaopei
 * @Date 2021/3/13 14:09
 * @Version 1.0
 */
@Repository
public interface SpuRepository  extends JpaRepository<Spu,Long> {

    Spu findOneById(Long id);

    Page<Spu> findByCategoryIdOrderByCreateTimeDesc(Long cid, Pageable pageable);

    Page<Spu> findByRootCategoryIdOrderByCreateTime(Long cid, Pageable pageable );

}
